#include <bits/stdc++.h>
using namespace std;

inline int read() {
	int x = 0, f = 0; char ch = getchar();
	while (ch < '0' or ch > '9') f |= (ch == '-'), ch = getchar();
	while (ch >= '0' and ch <= '9') x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}

int __stk[128], __top;
inline void write(int x) {
    if(x < 0) putchar('-'), x = -x;
	do { __stk[++__top] = x % 10, x /= 10; } while (x);
	while (__top) putchar(__stk[__top--] + '0');
}

const int mod = 998244353;

void Min(int &x, int y) { y < x and (x = y); }
void Max(int &x, int y) { y > x and (x = y); }

void inc(int &x, int y) { (x += y) >= mod and (x -= mod); }
void mul(int &x, int y) { x = 1ll * x * y % mod; }

int q_pow(int x, int k) { int res = 1; for (; k; k >>= 1, mul(x, x)) if (k & 1) mul(res, x); return res; }

bool stmer;

const int N = 1010, M = 2e5 + 10;

int n, m, q, cnt;
int b[M];

struct edge {
    int u, v, w;
} e[M];

vector<int> f[N], g[N];

namespace Flow {
    const int inf = 1e9;
    
    int s, t, ans1, ans2, cnt = 1;
    int hed[M], nex[M], to[M], w[M], c[M], vis[N], d[N], cur[N];
    
    queue<int> q;

    void add(int u, int v, int x, int y) { 
        nex[++cnt] = hed[u], hed[u] = cnt, to[cnt] = v, w[cnt] = x, c[cnt] =  y;
        nex[++cnt] = hed[v], hed[v] = cnt, to[cnt] = u, w[cnt] = 0, c[cnt] = -y;
    }
    
    bool spfa() {
        for (int i = 0; i <= t; i++) d[i] = inf;
        q.push(s), d[s] = 0;
        while (!q.empty()) {
            int x = q.front(); q.pop(), vis[x] = 0, cur[x] = hed[x];
            for (int i = hed[x]; i; i = nex[i])
                if (w[i] and d[to[i]] > d[x] + c[i]) {
                    d[to[i]] = d[x] + c[i];
                    if (!vis[to[i]]) vis[to[i]] = 1, q.push(to[i]);
                }
        }
        return d[t] != inf;
    }
    
    int dinic(int x, int flow) {
        if (x == t) { ans2 += flow * d[x]; return flow; }
        int l = flow; vis[x] = 1;
        for (int i = cur[x]; i and l; cur[x] = i, i = nex[i])
            if (!vis[to[i]] and w[i] and d[to[i]] == d[x] + c[i]) {
                int p = dinic(to[i], min(l, w[i]));
                if (!p) d[to[i]] = -1; w[i] -= p, w[i ^ 1] += p, l -= p;
            }
        vis[x] = 0;
        return flow - l;
    }

    unordered_map<int, int> mp[N];

    int ask(int x, int w) {
        if (mp[x].count(w)) return mp[x][w];

        cnt = 1, s = 0, t = 2 * n + 2;
        for (int i = 0; i <= t; i++) hed[i] = 0;

        for (int i = 1; i <= n; i++) add(s, i, 1, 0), add(i + n, t - 1, 1, 0);
        add(t - 1, t, x, 0);

        for (int i = 1; i <= m; i++) if (e[i].w <= w) add(e[i].u, e[i].v + n, 1, e[i].w);

        ans1 = ans2 = 0;
        while (spfa()) ans1 += dinic(s, inf);

        return mp[x][w] = (ans1 == x ? ans2 : -1);
    }
}

bool edmer;
signed main() {
	freopen("journey.in", "r", stdin);
	freopen("journey.out", "w", stdout);
	cerr << "[Memory] " << (&stmer - &edmer) / 1024 / 1024 << " MB\n";
	
    n = read(), m = read(), q = read();
    for (int i = 1; i <= m; i++) e[i] = { read(), read(), read() }, b[++cnt] = e[i].w;

    sort(b + 1, b + cnt + 1), cnt = unique(b + 1, b + cnt + 1) - b - 1;

    if (q == 0) exit(0);

    if (cnt) {
        f[1].push_back(b[1]), g[1].push_back(b[1]);
        for (int i = 2, pos = 1; i <= n; i++) {
            int val = Flow :: ask(i, b[pos]);
            while (val < 0 and pos < cnt) val = Flow :: ask(i, b[++pos]);
            if (val < 0) break;

            int p = pos;
            while (p <= cnt) {
                int l = p + 1, r = cnt, res = p; val = Flow :: ask(i, b[p]);
                while (l <= r) {
                    int mid = (l + r) >> 1, sum = Flow :: ask(i, b[mid]);
                    if (sum ^ val) r = mid - 1; else l = mid + 1, res = mid;
                } f[i].push_back(b[p]), g[i].push_back(val), p = res + 1;
            }
        }
    }

    while (q--) {
        int c = read(), ans = n * c;
        for (int i = 1; i <= n; i++) {
            int p = upper_bound(f[i].begin(), f[i].end(), c) - f[i].begin() - 1;
            if (p < 0) break; Min(ans, g[i][p] + (n - i) * c);
        }
        write(ans), putchar('\n');
    }

    cerr << "[Runtime] " << (double) clock() / CLOCKS_PER_SEC << " seconds\n";
	return 0;
} 